package cn.zjitc.ioc.anno.dao.impl;

import cn.zjitc.ioc.anno.dao.UserDao;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Repository;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

@Repository("userDao")
public class UserDaoImpl implements UserDao {
    @Value("普通数据")
    private String str;
    @Value("${jdbc.driver}")
    private String driver;
    @Override
    public void save() {
        System.out.println(str);
        System.out.println(driver);
        System.out.println("UserDao2 running");
    }
    @PostConstruct
    public void init() {
        System.out.println("初始化方法");
    }
    @PreDestroy
    public void destroy() {
        System.out.println("销毁方法");
    }
}
